public class T05 {
  
  public synchronized void m1() {
    System.out.println(Thread.currentThread().getName() + "m1 start ...");
    try {
      Thread.sleep(10000);
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
    System.out.println(Thread.currentThread().getName() + "m1 end ...");
  }
  
  public void m2() {
    System.out.println(Thread.currentThread().getName() + "m2 start ...");
    try {
      Thread.sleep(5000);
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
    System.out.println(Thread.currentThread().getName() + "m2 end ...");
  }
  
  public static void main(String[] args) {
    T05 t05 = new T05();
    
    new Thread(t05::m1, "t1").start();
    new Thread(t05::m2, "t2").start();
  }
}
